package operation;
import book.BookList;
import java.util.Scanner;
public class ReturnOperation extends FindBook implements IOperation{
    @Override
    public void word(BookList bookList){
        System.out.println("归还图书!");
        System.out.println("请输入你归还的图书!");
        Scanner scanner = new Scanner(System.in);
        String name = scanner.nextLine();
        int ret = findBook(bookList, name);
        if(ret != -1){
            bookList.getBook(ret).setBorrowed(false);
            System.out.println("归还成功!");
        }
        else{
            System.out.println("没有找到此书!");
        }
    }
}
